//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#ifndef GENERAL_PROPERTIES_HPP
#define GENERAL_PROPERTIES_HPP

#include "GenericPropClasses.hpp"

#define MAXLEN_TERMINAL_NAME 16

class CGeneralPropPage : public CTerminalPropPage
{
public:
	virtual BOOL Validate();
	virtual BOOL StoreData();
	CGeneralPropPage (CTerminalPropSheet *pOwner = NULL);
	~CGeneralPropPage();

	virtual BOOL WriteRegistrySettings();
	virtual BOOL ReadRegistrySettings();
	void UpdateTerminalName();

	LPCTSTR GetId()
	{ return TEXT("General"); }

	BEGIN_MSG_MAP(CGeneralPropPage)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		NOTIFY_HANDLER (0, PSN_SETACTIVE, OnSetActive)
		COMMAND_HANDLER (IDC_DEF_RESET_CHK, BN_CLICKED, OnResetCheck)

		CHAIN_MSG_MAP (CTerminalPropPage)
	END_MSG_MAP()

	LRESULT OnSetActive (int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnResetCheck (WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);

protected:
	void GetOsInfo();
	void UpdateOsInfo();
	void UpdateOemInfo();
	BOOL GetProductID();
	void UpdateProductID();
	BOOL m_bSetDefaults;
	
	
	TCHAR m_TerminalName[MAXLEN_TERMINAL_NAME];
	TCHAR m_osVersion [255];
	TCHAR m_oemVersion [255];
	TCHAR m_oemProductID [50];
	

	CWindow m_dispOsVersion;
	CWindow m_resetDefaultsCheck;
	CWindow m_dispOemVersion;
	CWindow m_dispOemProductID;
	CWindow m_wndTerminalName;
	CWindow m_MACAddress;
	CWindow m_Version;
};


#endif // GENERAL_PROPERTIES_HPP
